<?php 
session_start();
require_once("../includes/public.inc.php");
$userinfo = isset($_SESSION['userinfo'])?$_SESSION['userinfo']:'';
if (!empty($userinfo)) {
	$orderid = $_GET['id'];
	$result = mysql_query('select * from '.DBQIAN.'buylog where id='.$orderid);
	$order = mysql_fetch_array($result);
// 	print_r($order);exit;
}
?>

<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,user-scalable=no,maximum-scale=1,initial-scale=1">
<title>订单详情</title>
<link type="text/css" href="css/css.css" rel="stylesheet" />
<link type="text/css" href="css/pz-mobile.css" rel="stylesheet" />
<script type="text/javascript" src="../js/pz-mobile.js"></script>
<script type="text/javascript" src="../mobile/js/jQuery.js"></script>
<style>
.panel_ul{list-style:none; padding:0px}
.panel_ul *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}
.show_li{padding:5px;width:50%;float:left;}
.list_li{padding:5px;width:100%;}
.list_li .trade-panel{position:relative;height:70px;background:#fff;border: 0px solid transparent;border-radius: 5px;-webkit-border-radius: 5px;-webkit-box-shadow: 0px 2px 3px rgba(0,0,0,0.3);box-shadow: 0px 0px 3px rgba(0,0,0,0.3);}
.list_li img{height:70px; width:80px; border:5px #fff solid;}
.list_li .trade-ds{padding:5px; top:0; left:80px; position:absolute;background:none;border-radius:0 0 5px 5px;-webkit-border-radius:0 0 5px 5px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;}
.list_li .show_name{ font-size:13px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;display:block;}
.list_li b{font-size:14px;color:#FF0000;padding-right:5px}
.list_li del{font-size:12px;color:#666;}
.list_li .point{font-size:12px;color:green;display:block;}

.show_li img{width:100%;border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0}
.show_li .trade-panel{background:#fff;border: 0px solid transparent;border-radius: 5px;-webkit-border-radius: 5px;-webkit-box-shadow: 0px 2px 3px rgba(0,0,0,0.3);box-shadow: 0px 0px 3px rgba(0,0,0,0.3);}
.show_li .trade-ds{padding:5px; height:65px;background:#fff;border-radius:0 0 5px 5px;-webkit-border-radius:0 0 5px 5px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;}
.show_li .show_name{ font-size:13px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;display:block;}
.show_li b{font-size:14px;color:#FF0000;padding-right:5px}
.show_li del{font-size:12px;color:#666;}
.show_li .point{font-size:12px;color:green;display:block;}
.div-jg{width: 96%;height:50px;margin:5px 2%;border-bottom:1px solid #ecebf1;padding-top: 5px;font-size: 1rem;line-height:50px}
.bottom_menu{
	bottom: 0;
	position: fixed;
	height:50px;
	width: 100%;
	z-index: 11109;
	background:#fff;
	border-top:1px solid #d9dadc;
}
.bottom_menu ul li{
	width:33.3%;
	height:50px;
	float:left;
	color:#fff;
	list-style-type:none;
}
.bottom_menu ul li a{
	font-size:0.6rem;
	text-decoration:none;
	color:#fff;
}
input{border:none}
</style>
<script type="text/javascript"> 
$(function(){
	$(window).scroll(function() {
		if ($(window).scrollTop()>150){
			$(".bt-top").css("position", "fixed");
		}else{
			$(".bt-top").css("position", "relative");
		}
	});
	$(".tpbtn").click(function() {
		if ($(this).hasClass("on")){
			$("#J_Shade").removeClass("none");
			$(".circle").removeClass("hide").addClass("show");
			$(this).removeClass("on").addClass("off");
		}else{
			$("#J_Shade").addClass("none");
			$(".circle").removeClass("show").addClass("hide");
			$(this).removeClass("off").addClass("on");
		}
		
	});
});
</script>
<script type="text/javascript">
    $(function () {
        $("#number").change(function(){
			var money = parseFloat($(this).val())*parseFloat($("#price").val())-<?=$credit?>;
// 			alert(money);
			$("#totalmoney").val(money);
        });
        $("#submit").click(function(){
            alert("5");
			if ($("#city").val() == "")
			{
				alert("请选择城市");return false;
			}
			if ($("#address").val() == "")
			{
				alert("请填写具体的配送地址");return false;
			}
        });
        $("#cancle").click(function(){
        	if(confirm("您确认要清空吗？"))
            {
        		location.href="orderstatus.php?act=cancle&orderid=<?=$order['id']?>";
            }
        });
    });
</script>
</head>
<body style="BACKGROUND: none;">
	<ul class="top-tool" style="top:0px; left:0px">
		<a href="javascript:history.go(-1)"><span class="back"><img src="./image/back_icon.png"></span></a>
		<span class="title">付款</span>
		<a href=""><span class="home"><img src="./image/zy_icon.png"></span></a>
	</ul>
	<div style="height:50px"></div>
	<form  method="post" action="gopay.php">
	<div class="div-jg" style="background:#ffa44d;border-radius:5px;color:#fff;text-align:center;height:30px;line-height:30px">
		<span>
		<?
		switch ($order['status'])
		{
			case 1: echo "等待买家付款";break;
			case 2: echo "等待店铺发货";break;
			case 3: echo "等待买家付款";break;
			case 4: echo "等待买家收货";break;
			case 5: echo "等待店铺发货";break;
			case 6: echo "交易完成";break;
			case 7: echo "订单已关闭";break;
			case 8: echo "订单被卖家关闭";break;
		}
		?>
		</span>
	</div>
	<div style="height:100px;background:#f2f2f3;margin:5px 1%;padding:5px 3%;width:92%;border-radius:10px">
		<img alt="" src="image/qiandao.png" style="float: left;margin: 35px auto;">
		<p style="text-align:right;float:right;width:80%;">收货人：<?=$order['name']?>,&nbsp;联系方式：<?=$order['tel']?></p>
		<p style="text-align:right;float:right;width:80%;font-size:0.9rem;margin:0">收货地址：<?=$order['province'].' '.$order['city'].' '.$order['address']?></p>
	</div>
	<ul class="panel_ul" style="background:#fff;">
<?php 
require_once ("../mobile/shop.php");
$pro = getProductDetail($order['product_id']);
echo "
		<li class='list_li'><!--<li class='list_li'>-->
			<div class='trade-panel'>
				<a href='productdetail.php?id=".$order['product_id']."'><img src='".$pro['img']."' width='100%' height='100px'></a>
				<div class='trade-ds'>
					<span class='show_name'>".$pro['name']."</span>
					<span class='show_name' style='color:gray'>颜色分类:".$order['color'].",商品规格:".$order['size']."</span>
					<b>¥&nbsp;".$pro['price']."</b>
					<input type='hidden' id='price' value='".$pro['price']."'>
				</div>
			</div>
		</li>";
?>
	</ul>
	<div class="div-jg">
		<span style="font-size: 0.9rem;float:left">购买数量</span>
		<span style="font-size: 0.9rem;float:right;"><?=$order['quantity']?></span>
	</div>
	<div class="div-jg">
		<span>商品优惠：
		<?if ($order['yh_price'])
		{
			echo '红包抵现 省'.$order['yh_price'].'元';
		}
		else 
		{
			echo '无';
		}
		?>
		</span>
	</div>
	<div class="div-jg">
		<span>合计</span>
		<span style="text-align:right;float:right;height:28px"><?=$order['should_pay']?>元</span>
	</div>
	<div class="div-jg">
		<span>订单编号</span>
		<span style="text-align:right;float:right;height:28px"><?=$order['ordernumber']?></span>
	</div>
	<div class="div-jg">
		<span>买家留言：</span>
		<span style="text-align:right"><input type="text" value="<?=$order['note']?>" readOnly="readonly" style="width: 80%;border:none;height:50px;text-align:right;float:right"/></span>
	</div>
	<div style="height: 50px"></div>
	<div class="bottom_menu">
		<ul>
		<?php 
		if ($order['status']==1 || $order['status']==3)//下单和未付款
		{
			echo '<li></li>
			<li><input type="button" name="cancle" id="cancle" onclick="location.href=\'orderstatus.php?act=cancle&orderid='.$order['id'].'" value="取消订单" style="background:#d9dadc;color:#000;width: 100%;height: 100%;font-size: 1rem"></li>
			<li><input type="submit" id="submit" name="submit" value="付款" style="background:#F40;color:#fff;width: 100%;height: 100%;font-size: 1rem"></li>
			';
		}
		else if ($order['status']==2 || $order['status']==5)//未发货、已付款
		{
			echo '<li></li>
			<li></li>
			<li><input type="button" name="cancle" id="cancle" onclick="location.href=\'orderstatus.php?act=cancle&orderid='.$order['id'].'" value="取消订单" style="background:#d9dadc;color:#000;width: 100%;height: 100%;font-size: 1rem"></li>
			';
		}
		else if ($order['status']==4)//已发货
		{
			echo '<li></li>
			<li></li>
			<li><input type="button" name="confirmsh" id="confirmsh" onclick="location.href=\'orderstatus.php?act=confirm&orderid='.$order['id'].'" value="确认收货" style="background:#d9dadc;color:#000;width: 100%;height: 100%;font-size: 1rem"></li>
			';
		}
// 		else if ($order['status']==6 || $order['status']==8 || $order['status']==7)//已收货、订单作废、取消订单
// 		{
// 			echo '<li></li>
// 			<li></li>
// 			<li><input type="button" name="delete" id="delete" onclick="location.href=\'orderstatus.php?act=delete&orderid='.$order['id'].'" value="删除订单" style="background:#d9dadc;color:#000;width: 100%;height: 100%;font-size: 1rem"></li>
// 			';
// 		}
		?>
		</ul>
	</div>
	</form>
	<!-- 
	<div class="div-jg">
		<span>买家留言：</span>
		<span style=""><input type="text" placeholder="(选填)对本次交易的说明" style="width: 80%;border:none;border-bottom: 1px solid #ecebf1;text-align:right;float:right"/></span>
	</div> -->
	
</body>
</html>